import React from 'react';
import { observer } from 'mobx-react';
import { WeaCheckbox } from "ecCom";

interface Props {
    value: string;
    viewAttr:any;
    onChange: (string) => void;
}

@observer
export default class CheckboxCom extends React.Component<Props, any> {
    constructor(props){
        super(props);
    }

    onChange = (v) => {
        this.props.onChange(v);

    }

    render() {
        return (
            <div style={{float:'left'}}>
            <WeaCheckbox
                {...this.props}
                checked={this.props.value == '1'}
                onChange={this.onChange}
            />
            </div>
        )
    }

}